//
//  EasyToTescoConfig.h
//  EasyToTesco2.0
//
//  Created by 杨森 on 2017/3/18.
//  Copyright © 2017年 EasyToTesco. All rights reserved.
//

#ifndef EasyToTescoConfig_h
#define EasyToTescoConfig_h

/**
 *  判断个人或商家专区
 */
#define JudgeInvididualOrSeller ([ReadLoginData readLoginData].allKeys.count == 0)||([[[ReadLoginData readLoginData] objectForKey:@"lb"] isEqualToString:@"0"])||([[[ReadLoginData readLoginData] objectForKey:@"lb"] isEqualToString:@"1"])


/**
 *  获取RGB颜色
 */
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define RGB(r,g,b) RGBA(r,g,b,1.0f)

// rgb颜色转换（16进制->10进制）
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height

#define IOS_SYSTEM_STRING [[UIDevice currentDevice] systemVersion]

/** 多线程GCD*/
//GCD - 在Main线程上运行
#define EASY_DISPATCH_MAIN_THREAD(mainQueueBlock) dispatch_async(dispatch_get_main_queue(), mainQueueBlock)
//GCD - 开启异步线程
#define EASY_DISPATCH_GLOBAL_QUEUE_DEFAULT(globalQueueBlock) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), globalQueueBlock)

#define WeakSelf(type)  __weak typeof(type) weak##type = type;
#define StrongSelf(type)  __strong typeof(type) type = weak##type;


//背景颜色
#define BACKGROUND_COLOR [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0]

//字体选中颜色  navBar颜色 app主色调
//#define DEFAULT_COLOR [UIColor colorWithRed:((float)((0xFF6347 & 0xFF0000) >> 16))/255.0 green:((float)((0xFF6347 & 0xFF00) >> 8))/255.0 blue:((float)(0xFF6347 & 0xFF))/255.0 alpha:1.0]
#define DEFAULT_COLOR [UIColor colorWithRed:235.0/255.0 green:21.0/255.0 blue:63.0/255.0 alpha:1.0]

#define RandColor RGB(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))


//定义UIImage对象
#define ImageNamed(_pointer) [UIImage imageNamed:[UIUtil imageName:_pointer］


//判断当前设备是不是iphone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

//判断当前设备是不是iphone6
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)


/**
 *  判断返回数据code
 */
#define JudgeBackDataCode [[NSString stringWithFormat:@"%@",object[@"code"]] isEqual:@"1"]
/**
 *  状态栏+导航栏高度
 */
#define NavBar_StatusHEIGHT 64


/**
 *  判断用户登录
 */
#define JudgeLogInData [ReadLoginData readLoginData].allKeys.count != 0

#define USERNAME [[ReadLoginData readLoginData] objectForKey:@"username"]
/**
 *  NSLog 输出宏
 */
#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(...)
#endif

#define FONT(s)       [UIFont systemFontOfSize:s]
#define BOLDFONT(s)       [UIFont boldSystemFontOfSize:s]
#define Font_Big          [UIFont systemFontOfSize:15]
#define Font_Normal               [UIFont systemFontOfSize:14]
#define Font_Small                [UIFont systemFontOfSize:13]

/**
 *  SN 邀请码
 */

//商品id
#define SN_PRODUCT_ID @"productId"
//邀请码id
#define SN_EXPAND_ID @"expandId"
//url scheme启动app
//#define NOTIFICATION_SN_OPENURL_SHOPDETAILS  @"shopDetailsUrlSchemeNotification"
//粘贴板
//#define NOTIFICATION_SN_PASTE_SHOPDETAILS  @"NOTIFICATION_SN_PASTE_SHOPDETAILS"
//判断本地是否有邀请码
#define SN_IS_EXIST [[ExpandSnPlist shareExpandPlist] isSnPlistFileExist]


/**
 *  商品订单
 */

//确认订单
#define NOTIFICATION_ORDER_CINFIRMRECEIPT @"goodOrderConfirmReceiptNotification"
//支付
#define NOTIFICATION_ORDER_PAY @"goodOrderPayNotification"
//订单详情
#define NOTIFICATION_ORDER_DETAILS @"goodOrderDetailsNotification"

#define NOTIFICATION_TOUR_ORDER_PAY @"goodTourOrderPayNotification"

#define NOTIFICATION_TOUR_ORDER_DETAILS @"goodTourOrderDetailsNotification"


/**
 *  ALiPay
 */
// 支付宝APPID
#define ALI_APPID @"2016082401797979"
// 支付宝私钥
#define ALI_PrivateKey @"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALw/QUx8MsunZS4G57zhkBMWiRWX8Ec5OcfSUSm8qnXmPjPPt+KzSRyaee/ohLE4CvsG5Vivr71FRZqkrEq7yAjOUaSaMJulSobpKOiYx+LmmzFtMjUhJV2HjR5mLTQ497qCP/Uc1zlC6jwZjILf2x0pF8+IhfCXAasnogJtQiTlAgMBAAECgYAXaO5f6poOhXSpsqYi8RIPrZ/ClbCFyvIKjXcWb6XrH4TgwJYnlRAkhHlhglLuDwAek4715nM+YFz1jED40j1f0/4T19qbjFOQMDiMNHk+JjQ73jGRcCKkjSvff4ZFMb+UbYf0wSRvAV6UKbms6RQyr68w42QXXyijDZi6L8EIgQJBAPbv/hKcLHUvaUOlG0fCnm57RMG7xIAaie+1sGtPjz0HEeNc97V3cNclO15/X+Op8TN4QDjBaS4CmGRfT5xjuDUCQQDDJ9v+TKXAP2kqXEYHSOhDh9R4R8ZT5OxZ0qJUZQDka5iQ7ZkK3NtmQRdWSi4Eo2O/yeJIAoKowrHSKAGEUC/xAkEAhPFx1O0VlkVfI5b5F+o0R4C/5JlFUj53coFbqHpdwFpVDBYaGi1ip8GYs+hZZIUyoSYlVSjzilzFVIxnnOem3QJAfeqA4hI4O9NuGlvQ/zBGVBQWvcipqUWiTc4+2K8WpUra9F+pCD45/T7wPMe961Y0rPEoZAfin9qG+y6+080dMQJAaxCNHR7hj8vgFWp1/bJGFlE0V9Qzm3/VxJ5eEMzsJVm4qAdoNtItDScStKJZR3mfWNJ8t63MmymG0sxh8ABR6A=="

/**
 *  WeChat
 */
// 开放平台登录https://open.weixin.qq.com的开发者中心获取APPID
#define WX_APPID @"wx70dda5180e36f483"
// 开放平台登录https://open.weixin.qq.com的开发者中心获取AppSecret。
#define WX_APPSecret @"3db1bd631c4492f7829278c9953bf714"
// 微信支付商户号
#define MCH_ID  @"1389205202"
// 安全校验码（MD5）密钥，商户平台登录账户和密码登录http://pay.weixin.qq.com
// 平台设置的“API密钥”，为了安全，请设置为以数字和字母组成的32字符串。
#define WX_PartnerKey @"d0b1be31130f0ae99b54f12372107c3c"


#pragma mark - 统一下单请求参数键值

// 应用id
#define WXAPPID @"appid"
// 商户号
#define WXMCHID @"mch_id"
// 随机字符串
#define WXNONCESTR @"nonce_str"
// 签名
#define WXSIGN @"sign"
// 商品描述
#define WXBODY @"body"
// 商户订单号
#define WXOUTTRADENO @"out_trade_no"
// 总金额
#define WXTOTALFEE @"total_fee"
// 终端IP
#define WXEQUIPMENTIP @"spbill_create_ip"
// 通知地址
#define WXNOTIFYURL @"notify_url"
// 交易类型
#define WXTRADETYPE @"trade_type"
// 预支付交易会话
#define WXPREPAYID @"prepay_id"



#pragma mark - 微信下单接口

// 微信统一下单接口连接
#define WXUNIFIEDORDERURL @"https://api.mch.weixin.qq.com/pay/unifiedorder"

#endif /* EasyToTescoConfig_h */
